Fix two leaks in the pyxc interface. The dictionaries are being added
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 8 Nov 2005 13:53:27 +0000 (14:53 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 8 Nov 2005 13:53:27 +0000 (14:53 +0100)
to lists, and an extra ref was being left behind.

Signed-off-by: Sean Perry <sean@xensource.com>
Signed-off-by: Robert Read <robert@xensource.com>
tools/python/xen/lowlevel/xc/xc.c

index f7a00037e9f720afa0bcfd19bb2a4bb93ca4fb7e..e2585dc5edca6ec01c0277c0eb493fad92bae612 100644 (file)
@@ -342,6 +342,7 @@ static PyObject *pyxc_domain_getinfo(PyObject *self,
                                   "ssidref",   info[i].ssidref,
                                   "shutdown_reason", info[i].shutdown_reason);
         PyDict_SetItemString(info_dict, "handle", pyhandle);
+        Py_DECREF(pyhandle);
         PyList_SetItem(list, i, info_dict);
     }
 
@@ -388,7 +389,7 @@ static PyObject *pyxc_vcpu_getinfo(PyObject *self,
         cpumap >>= 1;
     }
     PyDict_SetItemString(info_dict, "cpumap", cpulist);
-
+    Py_DECREF(cpulist);
     return info_dict;
 }